home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AOL File Library: 4,401 to 4,500
/
aol-file-protocol-4400-4401-to-4500.zip
/
AOLDLs
/
PDA-Newton Development
/
ND Newt Development Environm
/
newt-devenv-31.sit
/
using.txt
< prev
next >
Wrap
Text File
|
1995-08-11
|
17KB
|
381 lines
using.txt
8/11/95
Newt 3.1
(c) 1995, S. Weyer, All Rights Reserved Worldwide.
weyer@netaxs.com
- Getting Started
Where to Find Newt, Slurpee, NewtATut, NewtTurT,...
Exploring Newt's Application Personality
- Interface Guide
Main View (Edit Objects/Methods)
Eval Controls
About Newt
ExprKbd
Eval Log
- Preferences
=====
Getting Started
Where to Find Newt, Slurpee, NewtATut, NewtTurT,...
-----
Presumably, you have already obtained Newt or you would not be reading this.
A compressed file usually named newt-devenv-vv.sit or .hqx (vv = version
number, e.g., 3.1 = 31) should contain Newt-vv.pkg and .txt files. See
Newt.1st or newt-faq.txt for servers/sites.
- Install Newt using Connection Kit (or other package downloader).
- [NEW in 3.0] You can install library plug-ins that contain source text for a
project, and then copy this text to your current folder. see Select Library
and Copy Source. For example, applic0.lib and/or applic2.lib (these are
packages) contain the text for applic0.nwt and aplic2.nwt.
- Download examples. Earlier versions of Newt had some built-in demos. To
save space and distribute more examples and source, I provide these
separately in applic0.nwt, applic2.nwt, graphic0.nwt. You can, of course,
enter the source yourself via handwriting and tapping Newton's "keyboard"
(see Edit Methods). However, to save time and minimize syntactic errors, I
would recommend transferring the text from the .nwt source files. You can
copy/paste text between ----- into the Notepad of Connection Kit and then
Synchronize. Or, you can use a terminal emulator program on your desktop
computer with either Slurpee or Figgle's Typomatica to transfer chunks of
text to separate Notepad entries. You can put everything in Unfiled or
existing or new folders and mix with other notes, though I would recommend
putting source entries for separate apps/files into separate folders.
- If you take the the time to install Slurpee 1.6 and configure your
desktop terminal emulator, not only can you transfer source text into the
Newton (and later, resource files for bitmaps and sounds), but also you can
use Slurpee as an "Inspector": you can type in a text field on the Newton.
When you evaluate expressions, values and errors can be redirected to your
desktop system, which can be quite handy for debugging.
- Start Newt from Extras (or from NewtATut or NewtTurT or Slurpee)
- Tap overview and select About Newt. You can tap Save (located in the bottom
Eval Controls) to save a registration form to your Notepad. close About Newt.
Exploring Newt's Application Personality
-----
Try the following (see also the NewtATut interactive tutorial). You should
have NewtPack installed (see packages.txt) if you want to be able to Save
your application.
- select the folder at top of screen containing your sources.
- tap the Expr button (in Eval Controls)
- select the expression :doObj('add,'MyApp)
- tap Eval
- select MyApp from the popup -- a application view with title appears
- tap Eval, select MyApp.myInputProto -- a user prototype object is defined in
the running application (to be used by num1 and num2 fields)
- tap Eval, select MyApp+button -- this dynamically adds a button to MyApp.
you can tap on the button; if the About box (float) has not yet been created,
you will hear a sound
- MyApp+float -- this adds a floating view dynamically
- MyApp.float+aboutText -- adds a basic text object. close the floating view.
now tap the About button
- MyApp+num1 -- this adds an input field that expects numbers. You can write a
number in the field, or double-tap for a calculator keypad. When the total
object exists, it will be updated.
- MyApp+num2 -- adds a second input field
- MyApp+round -- this adds a checkbox that makes total an integer or real
- MyApp+total -- this displays the total of num1 and num2
Hopefully, you have followed these steps correctly/successfully, and have a
functioning application. If you have NewtPack installed and your
application is visible,
- tap the Save button
(the button should stay highlighted, and a progress box should appear)
- tap Extras, and tap its icon
If you have the sources for an application in the current folder (transferred
via Slurpee, or copied from NewtATut), you can rebuild the application later
from these sources by Evaluating the expression:
:doObj('build, 'myApp)
(The 2nd arg is the app symbol -- first line of application object definition).
Exploring Newt's Turtle Personality
-----
[this has been moved to turtle.txt]
=====
Interface Guide
The following sections cover the major interface areas of Newt -- the views
available by tapping overview (the dot between the two fixed scroll arrows at
the bottom of the screen).
Main View (Edit Objects/Methods)
-----
This is the initial screen where you browse and edit objects and methods. Other
views (windows) are used for drawing, printing, building applications, and as
control palettes.
overview
Tap the overview dot (between the fixed scroll arrows at center bottom) to pop
up a list of current views, containing built-in views such as About Newt, and
Eval Log, palettes such as Eval Controls, packages such as Slurpee (if
installed), and any user-created applications, e.g., Hello World. You can
also add NTK apps/books to this list. If you have installed plug-ins such as
NewtDraw or ExprKbd, other entries may appear.
scroll arrows
In Edit Methods (Main View) or Eval Log (if visible), the main text field
scrolls.
folder tab (top of screen)
Newt uses the folder label for organizing "newts" for Save in Edit Methods
(Main View), Eval Log, and About Newt (and Newt Drawing, if installed). Newt
"compiles" (i.e., makes an executable version of) methods and checks objects
found in the current folder, and notes errors (if any) in Eval Log.
source name
The name of current object, method or page appears in a "picker list", preceded
by a diamond. (Status messages may appear here also).
action button (envelope icon)
You can Save and Revert, Duplicate, Delete current source. You can also copy
templates from a library folder -- see later action button descriptions. Newt
does not currently provide a filing button -- however, you can look at,
reorganize, print, fax, beam etc. your saved newts (source, screen
snapshots, print results, registration form) outside Newt in the generic
Notepad application.
We will now cover the other palettes and views, and return to editing and
creating methods later under Edit Methods (continued).
Eval Controls
-----
The following controls are found in a floating, draggable palette, located
initially at the bottom of Newt's screen: Eval field, Expr, keyboard icon,
Eval button, Print?, and Save. As a general rule, you will want to keep Eval
Controls visible, rather than closing and re-opening it.
Eval field
This field can contain a short program in NewtonScript. Tap the Eval button to
execute it. Techniques for entering expressions include combinations of
- handwriting -- not great, given the amount of punctuation needed
- copy & drag text selections to/from the margin "clipboard"
- tap the keyboard icon for a floating kbd without "do you want to add" prompts
- double-tap for the default alphanumeric keyboard and use extra spaces
around some NewtonScript punctuation to reduce spurious prompts
- keyboards, e.g., KbdPro, or "reverse terminal emulators", e.g., Typomatica
(Figgles Utils) or Slurpee
- tap Times in Newt Controls (if NewtDrawing installed) to fill in a standard
"for" expression
- select complete expressions from the customizable Expr list
- use the variable names times, dist and deg, so you can change numbers in
the Times, Dist and Deg fields in Newt Controls (if NewtDrawing installed)
rather than in the middle of the Eval field.
- select partial expressions from the ExprKbd plug-in palette [if installed]
- tap code items in Newt books like NewtATut, NewtTurT, NewtPFB
Expr
A popup list of sample expressions appears -- you can customize this. If you
select an expression, it appears in the Eval field. You can then edit it,
and/or tap the Eval button to execute.
keyboard icon
This toggles (either shows or hides) a floating alphanumeric keyboard that does
not prompt for additions to the dictionary. You can double-tap in the Eval
field for the standard keyboard.
Eval button
Tap the Eval button to evaluate (compile and execute) the expression in Eval
field. The button remains highlighted during execution. (During interruptible
methods, e.g., squiral2, it changes to Stop and you can tap it to terminate
execution.) If you spell something incorrectly, or use incorrect parameters or
syntax, Eval Log (or a system error box) will appear with a somewhat cryptic
error message or code (see Errors). You can add additional error messges
via the ErrCnst plug-in. Basically, you will have to compare what
you wrote more carefully against the example, edit it and try again. (Other
info and examples available to registered users).
WARNING: NEITHER NEWTON NOR NEWT PROVIDE A GENERAL INTERRUPT CAPABILITY. SO,
UNLESS YOU LIKE USING THE MANUAL RESET BUTTON IN THE BACK, USE COMMON SENSE IN
CHOOSING VALUES FOR ITERATION, RECURSION OR DISTANCE THAT ARE NOT "TOO LARGE".
I will generally provide some reasonable values to try. Newt's default
behavior is to finish executing the entire expression before checking for user
actions like button taps. There is a facility provided in Newt to replace the
NewtonScript "for" iteration construct. This facility executes each step in
the background, allows you to interrupt Newt, and is covered in the manual.
Print?
If checked (default: no), the Eval Log view pops up with expression and results
after you tap the Eval button. Error messages will appear regardless of this
setting. If you have Slurpee connected as an Inspector, print and error results
appear in your desktop terminal emulator.
Heap
The first time you tap this, the Newton begins to display the amount of
heap remaining & updates every ~10 seconds. If you tap again, it immediately
does a "gc" (garbage collect) which should increase the number. To turn off,
close Eval Controls, then re-open it from the overview menu.
Save
The current (top) view is saved, usually to the Notepad under the current
folder tab category. For Edit Methods, the method source, if edited, is saved
(same as Save under action button) if there are no errors. For About Newt, a
text registration form is saved. For Eval Log, the current printed results
are saved. For Newt Drawing, the current drawing, if any, is saved. A user
application is saved either as a package if NewtPack is installed). If the
view is not recognized as an "application", Newt beeps.
Newt Drawing, Newt Controls
[see turtle.txt]
About Newt
-----
Select this via overview. Tap Save in Eval Controls to create a registration
form in Notepad under the current category (see folder tab) for later
printing, mailing, etc. Or, tap the $ button in order to register and pay
electronically if you have the Register application -- see register.txt
ExprKbd
-----
[if ExprKbd plug-in is installed]
This is a separate floating, draggable palette accessible via overview,
located initially on the right hand side of the screen. This can be used for
Eval field, but is most useful for source in Edit Methods (Main View).
As you select items from the text list, an expression is inserted into your
current source along with syntax for a function, method or slot. Customizing
this list is described in the manual (or you can change the plug-in tool
itself by modifying the exprkbdt.nwt example).
Eval Log
-----
See earlier comments under folder tab, scroll arrows, Print? and Save.
Slurpee, NewtATut, NewtTurT, etc.
-----
If Slurpee is installed, it will also appear in the overview list. If you
have started Newt from NewtATut or NewtTurt, titles for these books will
appear here also. You can also add other NTK packages (apps and books) for
convenience.
Your Applications
overview also contains the titles of applications you are currently developing
within Newt, based on source methods. Once you Save the application as a package,
it is available separately in Extras.
Edit Objects/Methods (continued)
-----
We now complete coverage of the interface by revisiting the main view.
source names
A "picker" at the top preceded by a diamond contains methods, objects and
pages defined in current folder (see folder tab). The diamond disappears
during editing (see Save, Revert). Status messages for lengthy operations
(Checking,Deleting, Copying) sometimes appear here. You can also select one
of the "new" names at the top of the menu to create a default template.
source text
As in the Eval field, you can use handwriting, copy&drag and keyboards to edit
your method, object or page source. You can change its name by editing. You
can Save, Revert, Duplicate or Delete it via the action button on right.
Conventions for different kinds of methods and objects and NewtonScript syntax
described in the manual. Also look at graphic0.nwt and applic0.nwt for
examples.
action button
Note: "..." after a command indicates that a popup menu or confirm dialog will
follow. If command beeps, then it's probably illegal in current context --
you may need to do a Revert, or Select Library first.
- Save
Assuming that the source name is valid, does not conflict with a pre-defined
"system" method, and successfully compiles, the method source is saved
(created or updated) as a "newt" (i.e., text Note) in the current folder.
Errors, if any, are noted in Eval Log, with the line of source indicated by
the error message. Newt saves only valid sources. So, if you cannot figure
out a compile error from the cryptic message, you could either Revert to
the earlier version, or comment out offending code (precede individual
lines with //, or wrap a section with /* <lines of code> */), so that you
can Save for now, get on with your life, and look at it later. Methods are
defined immediately; other objects are only checked but can be added
explicitly later, e.g., via :doObj.
- Revert
If you have unsaved changes, the diamond in front of the source name disappears.
Revert returns to the last version saved of the original method in the current
folder, or to the basic template.
---
- Add(Obj)
If you have a source for an object in the editor, this adds the object to your
application. If the first line is "myApp+aButton", this is equivalent to
:doObj('add, "myApp+aButton"). (This assumes you've added "myApp" earlier.)
- Build(App)
If you have a source for any object from an application visible in the editor,
this does a build of your application (adds application and all of its child
objects). If the first line is "myApp+aButton", this is equivalent to
:doObj('build, 'myApp) -- it adds "myApp", then "myApp+aButton", etc.
---
- Duplicate
This makes a copy of the current source. Give it a new name (no duplicate names
allowed) before Saving.
- Delete
Deletes current source from Notepad. It also deletes defined Newt method (if any)
but does not delete objects from an application. No confirmation.
- Delete All...
Deletes all current items from the current Notepad folder. It confirms first.
---
- Select Library...
Pops up a list of available library plug-ins, e.g., applic2.lib. (Note: you
can create these library packages directly from Newt itself).
- Copy Source... (formerly "Copy from")
Pops up a list of available sources in current plug-in. Copies source for
selection to the editor; to save to Notepad, make an editing change, possibly
changing the name, then Save. This could be useful for libraries of templates.
- Copy All...
Copies all sources from current library to current folder. It confirms first.
You may wish to do Delete All first.
---
Remove Package...
Pops up an alphabetical scrolling list of currently installed packages.
This can be convenient for getting rid of packages that you no longer need
(note: if you delete any of Newt's plug-ins while in Newt, be prepared to
quit immediately afterward; otherwise, you may encounter a memory error).
If you attempt to save a package whose name (appSymbol) already exists,
Newt will prompt you about removing it before proceeding (so, need to
remove it first yourself).
Preferences
-----
Newt saves your preferences for Print? and folder tab and others (including
Pen, Color, Newt? for NewtDraw) in a small "system soup" frame that persists
across Newt sessions. If you no longer need Newt, you can remove this
preferences frame via a soup utility (like StewPot) or directly from Newt
(evaluate EntryRemoveFromSoup(prefsEntry) just prior to exiting Newt).
Also, if you have used RUNewt earlier, this is no longer needed in 3.1 -- so,
you can remove the "RUNewt:TKnollSys" package. If you are careful, you can
remove the "RUNewt:Apps:TKnollSys" soup, and the "RunNewtRun:TKnollSys"
system preference with a soup utility.